package service.impl;

import dao.IBookDao;
import entity.Book;
import service.IBookService;

public class HBookService implements IBookService {
	private IBookDao dao;

	public IBookDao getDao() {
		return dao;
	}

	public void setDao(IBookDao dao) {
		this.dao = dao;
	}

	@Override
	public void addBook(Book book) {
		dao.saveBook(book);
	}

	@Override
	public Book selectBook(int id) {
		Book book = dao.findById(id);
		book.getUser().getName();
		book.getUser().setBooks(null);
		return book;
	}

}
